package org.smoozik.app.ihm;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenuItem;

public class SmoozikListener implements ActionListener {
	Smoozik frame;

	public SmoozikListener(Smoozik frame) {
		super();
		this.frame = frame;
	}

	public void actionPerformed(ActionEvent e) {

		Object source = e.getSource();
		if (source instanceof JMenuItem) {
			JMenuItem menu = (JMenuItem) source;
			String labelMenu = menu.getText();
			if (Constants.SETTINGS_LABEL.equals(labelMenu)) {
				frame.showSettingsFrame();
			}

			frame.repaint();
			frame.validate();
		}
	}

}
